package second.binarytree;


import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

public class Solution15 {
    public int sumOfLeftLeaves(TreeNode root) {
        if (root == null) return 0;

        int legt = sumOfLeftLeaves(root.left);
        int right = sumOfLeftLeaves(root.right);
        int mid = 0;
        if (root.left != null && root.left.left == null && root.left.right == null) mid = root.left.val;
        return legt + right + mid;
    }
}

